      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
         <ul class="nav nav-tabs mytabs">
		   <li class="active"><a href="#">编辑管理员</a></li>
		  <li ><a href="<?=site_url()?>/admin/index">管理员管理</a></li>
		  <li role="presentation"><a href="#"><i class="fa fa-plus"></i>  添加管理员</a></li>
		 
		</ul>
         
          <div class="row">
            <div class="col-md-12">
              <div class="table-responsive"> 
                 <form role="form" id="templatemo-preferences-form" onsubmit="return false;">
                 	<input type="hidden" id="id" value="<?=$admin['id']?>" />
                <div class="row">
                  <div class="col-md-6 margin-bottom-15">
                    <label for="firstName" class="control-label">用户名</label>
                    <input type="text" class="form-control" id="username" value="<?=$admin['username']?>" readonly>                  
                  </div>
                   <div class="col-md-6 margin-bottom-15">
                    <label for="lastName" class="control-label">姓名</label>
                    <input type="text" class="form-control" id="name" value="<?=$admin['name']?>">                 
                    </div>
                  </div>
                  <div class="row">
                  <div class="col-md-6 margin-bottom-15">
                    <label for="firstName" class="control-label">手机号</label>
                    <input type="text" class="form-control" id="cellphone" value="<?=$admin['cellphone']?>">                 
                  </div>
	               <div class="col-md-6 margin-bottom-15">
                    <label for="lastName" class="control-label">类型</label>
                    <select class="form-control margin-bottom-15" id="type">
						<option value="0" <?php if($admin['type'] ==0) echo "selected"; ?> >普通管理员</option>
						<option value="1" <?php if($admin['type'] ==1) echo "selected"; ?> >超级管理员</option>
					</select>          
                  </div>
                  </div>
	              <div class="row templatemo-form-buttons">
	                <div class="col-md-12">
	                  <button type="submit" class="btn btn-primary" id="submit_btn">修改</button>
	                </div>
                </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
<script>
	$(document).ready(function() {
		$("#submit_btn").click(function() {
			var id = $("#id").val();
			var name = $("#name").val();
			var cellphone = $("#cellphone").val();
			var type = $("#type").val();
			$.ajax({
				url : '<?php echo site_url('admin/update')?>',
				type : "post",
				async : false,
				data : {
					'id':id,
					'name' : name,
					'type' : type,
					'cellphone' : cellphone
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
						//window.location.reload();
					}else{
						alert(data.msg);
					}
				}
			});
		});
	}); 
</script>